﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FW.Core.Model;
using FW.Core.Repository;
using FW.Core.Service;

namespace FW.Service
{
    public class CrudService<T> : ICrudService<T> where T : Entity, new()
    {
        protected IRepository<T> repo;

        public CrudService(IRepository<T> repo)
        {
            this.repo = repo;
        }

        public IEnumerable<T> GetAll()
        {
            return repo.GetAll();
        }

        public void Insert(T t)
        {
            repo.Insert(t);
        }
    }
}
